home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / praf205e / yappxfer.doc < prev   
Text File  |  1995-04-01  |  9KB  |  296 lines

  1. YAPP(tm) protocol for Packet Radio binary file transfer
  2.  
  3. (c) 1986, Jeff Jacobsen - WA7MBL
  4.  
  5. Revision 1.1   06/23/86
  6.  
  7. ----------------------------------------------------------
  8.  
  9. YAPP PACKET TYPES
  10.  
  11. Size of packet data ranges from 2-258 bytes.
  12. len = length of following bytes (not including len)
  13.  
  14.  
  15. RR Rcv_Rdy      ACK  01
  16.  
  17. RF Rcv_File     ACK  02
  18.  
  19. AF Ack_EOF      ACK  03   [1.1]
  20.  
  21. AT Ack_EOT      ACK  04   [1.1]
  22.  
  23.  
  24. SI Send_Init    ENQ  01
  25.  
  26. HD Send_Hdr     SOH  len  (Filename)  NUL  (File Size in ASCII)  NUL  (Opt)
  27.  
  28. DT Send_Data    STX  len  (Data)    {if len=0 then data length = 256}
  29.  
  30. EF Send_EOF     ETX  01
  31.  
  32. ET Send_EOT     EOT  01
  33.  
  34. NR Not_Rdy      NAK  len  (Optional Reason in ASCII)
  35.  
  36. RE Resume       NAK  len  R  NULL  (File size in ASCII)  NULL
  37.  
  38. CN Cancel       CAN  len  (Optional Reason in ASCII)
  39.  
  40. CA Can_Ack      ACK  05
  41.  
  42.  
  43. {Following are for use in Server mode}
  44.  
  45.  
  46. RI Rcv_Init     ENQ   02   len   (Filespec requested - wildcard allowed)
  47.  
  48. TX Text         DLE   len  (ASCII text for display)  {to send text from server}
  49.  
  50.  
  51. {Unimplement - Reserved for Server Commands}
  52.  
  53. UU Comands      ENQ   03
  54.                 ENQ   04
  55.                 ENQ   05
  56.                 ...     
  57.                 ENQ   FF     
  58.  
  59.  
  60. STATE TABLES for SEND
  61.  
  62.  
  63. State         Send Pkt        Upon                  Next State
  64.  
  65. S (Send)      SI              RR                    SH
  66.                               RF                    SD
  67.                               NR                    Start/Done
  68.                               First few timeouts    S
  69.                               RI                    S
  70.                               Other/Timeout         Abort
  71.  
  72. SH (Hdr)      HD              RF                    SD
  73.                               NR                    Start/Done
  74. IF (RESUME)                   RE                    Move file position then SD
  75.                               Other/Timeout         Abort
  76.  
  77. SD (Data)     DT              (Not EOF)             SD
  78.                               (EOF)                 SE
  79.  
  80. SE (EOF)      EF              AF (More files)       SH
  81.                               AF (No More Files)    ST
  82.                               Other/Timeout         Abort
  83.  
  84. ST (EOT)      ET              AT                    Start/Done
  85.                               Other/Timeout         Start/Done
  86.  
  87.  
  88.  
  89. STATE TABLES for RECEIVE
  90.  
  91.  
  92. State      On    If           Do          Send Pkt       Next State
  93.   
  94. R (Rec)    SI (ready)                       RR              RH
  95.            SI (opt)*       open file        RF              RD
  96.            SI (not ready)                   NR              Start/Done
  97.            NR                                               Start/Done
  98.            Other/Timeout                                    Abort
  99.  
  100. (opt)*  If header info not desired it is ok to
  101.         open file and indiate ready for file
  102.  
  103. RH (Hdr)   HD               open file       RF              RD
  104.            HD (no room)                     NR              Start/Done
  105.  
  106. IF (RESUME)
  107.            HD Already       open file for   RE              RD
  108.               have file!    append at -256
  109.                             byte from EOF
  110.  
  111. ELSE       HD Already have file!!           NR              Start/Done
  112.  
  113.            SI                                               RH
  114.            ET                               AT              Start/Done
  115.            Other/Timeout                                    Abort
  116.  
  117. RD (Data)  DT              store data                       RD
  118.            EF              close file       AF              RH
  119.            Other/Timeout                                    Abort
  120.  
  121.  
  122.  
  123. OTHER STATE
  124.  
  125.  
  126. Any State          On CN         Send CA                   Start/Done
  127. except CW
  128.  
  129.  
  130. CW (Can_Wait)      On CA                                   Start/Done
  131.                    On CN         Send CA                   CW
  132.                    Timeout       Display Err Msg           Start/Done
  133.  
  134.  
  135. Abort                            Send CN                   CW
  136.  
  137.  
  138.  
  139. --------
  140. Starting States
  141.  
  142.  
  143. For 2 users not using Remote Server
  144.  
  145.     Sender goes to State S, Receiver to State R after manually
  146.     exchanging file names.  Since File Name is known, Recevier
  147.     may optionally send RF from state R and bypass file header.
  148.     Sender should give Receiver ample time to get into Receive
  149.     State.
  150.  
  151.  
  152.  
  153. For Remote Server Mode
  154.  
  155.   USER (Start)                                       Next State
  156.  
  157.   User wishing to Send                               S
  158.   User wishing to Receive          Send RI           R
  159.   Other Server Request             Send COMMAND      Start
  160.  
  161.   SERVER (Start)
  162.  
  163.   Gets SI                                            R
  164.   Gets RI             (file fnd)                     S
  165.                       (no file)    Send NR           Start
  166.  
  167.   Gets COMMAND                    (Do Command)       Start
  168.  
  169.  
  170. ---------------------------------------------------------
  171. All states except Send Data should timeout if nothing is heard
  172. for a period of time Tc (Crash timer).  Send Data isn't expecting
  173. any input and if it should receive some it must be a Cancel, or
  174. a TX (text) packet, otherwise Abort.
  175.  
  176.  
  177. --------
  178. Revision 1.1 - Added AF & AT to acknowledge End of File and
  179. End of Transfer.  This allows an automated sender to know that
  180. a file was received successfully.  It also helps get past a
  181. problem in the TNC-2 code by requiring the sender to wait for the
  182. Ack-EOT before switching from transparent mode back to converse
  183. mode.
  184.  
  185.  
  186. RESUME
  187. --------------
  188.  
  189. The new state introduced from FC1EBN in TPK are explained and is inserted in
  190. state table for recieve and send a file.
  191. Note that it's valid only if RESUME is true. This will implie or not
  192. the cancellation of file in case of transfer abort.
  193. This metode is ok for resume a file transfert but it have some limit if
  194. the two station hasn't the same RESUME state ON or OFF or not!
  195.  
  196. 1st example:
  197. A is a sender with RESUME OFF and B is receiver with RESUME ON.
  198. A initiate transfer with B and at certain time this will abort.
  199. In this case B (RESUME ON) don't erase the file and retry to download from A.
  200. Now the transfer always abort because B that already have a part of file
  201. request the resume that A interpret as Abort.
  202.  
  203. 2nd example:
  204. A is a sender and B is receiver both with resume ON.
  205. Today B download PINCO.ZIP (1st version, 10KByte) from A.
  206. Tomorrow in A there is the same filename but with lenght changed due a
  207. new version of program (PINCO.ZIP 2nd version, 11Kbyte).
  208. If B never delete the previous version of PINCO.ZIP from download directory
  209. the last 1000 byte of new file are append to the 10000 of the old one make
  210. simply caos!!
  211. This because Yapp never check if it is the same file (eg comparing filedate
  212. and time).
  213.  
  214.  
  215. YappC extension introduced in F6FBB BBS 5.14
  216. --------------------------------------------
  217.  
  218. When a user request a resume of a previuos file transfer, every Yapp frame
  219. long pklen byte is followed from a simple checksum byte.
  220.  
  221. So during a resume a Yapp Send_Data frame is:
  222.  
  223. STX len (Data) chksum
  224.  
  225. If len = 0 then data lenght = 256, note that len not include chksum byte and
  226. this is the checksum of Data byte.
  227.  
  228.  
  229. 21/5/92
  230.  
  231. Extensions to the Yapp protocol used in TPK v 1.65a and FBB v 5.14
  232. ------------------------------------------------------------------
  233.  
  234. HEADER extension:
  235. -----------------
  236.  
  237. The header now carry the DATE and TIME of the file being transmitted.
  238.  
  239. [SOH] [Len] [Filename] [NUL] [File Size] [NUL] [Date] [Time] [NUL]
  240.  
  241. Date and Time are the values reported by DOS, coded in 4 hexadecimal
  242. characters and sent in ASCII.
  243.  
  244. Receiver has the choice to use extended Yapp with checksum or normal Yapp.
  245.  
  246. - Normal Yapp reply is RF as before and the receiver can keep the
  247.   date and time information .
  248.  
  249. - Extended Yapp reply is : RT  Receive_TPK
  250.             and is coded : [ACK] [ACK]
  251.  
  252. If receiver reply is RT the protocol used will be what i have called YappC
  253. for Yapp with checksum. When sender get this packet he MUST use YappC.
  254.  
  255.  
  256. Data Packets extension:
  257. -----------------------
  258.  
  259. If receiver reply is RT the protocol used will be YappC. The checksum allow
  260. detection of packets corrupted along the link, particularly on the RS232
  261. lines where there is no error control or correction (or very poor !)....
  262.  
  263. Data packets : [STX] [Len] [Datas] [Checksum]
  264.  
  265. Checksum is the sum of all datas bytes on 8 bits like Xmodem.
  266. If checksum is bad receiver must send a Cancel and go in the CW state.
  267.  
  268.  
  269. Transfer Resuming:
  270. ------------------
  271.  
  272. A new field has been added to the resume reply to tell sender if receiver
  273. can use YappC or not.
  274.  
  275. - Resume reply for Yapp: (as used before by TPK and FBB)
  276.  
  277.     [NAK] [Len] [R] [NUL] [Received Length] [NUL]
  278.             I    I                I
  279.             I    I                +-- in ASCII as in the header
  280.             I    +-- as Resume !
  281.             I
  282.             +------- len of the following bytes
  283.  
  284. - Resume reply for YappC:
  285.  
  286.     [NAK] [Len] [R] [NUL] [Received Length] [NUL] [C] [NUL]
  287.                                                    I
  288.                 Tell sender i can go in YappC -----+
  289.  
  290.     When sender get this packet he must use YappC.
  291.  
  292. Any comments or suggestions : FC1EBN @ F6ABJ.FRPA.FRA.EU
  293.  
  294. 73's Gerard FC1EBN
  295.  
  296.